home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 May / PC Answers CD-ROM 7 (Future Publishing) (May 1995).iso / vbits / code / cert / trk3_eg / check_4 / check_4.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-02-28  |  3.8 KB  |  145 lines

  1. VERSION 2.00
  2. Begin Form frmcheck_4 
  3.    BackColor       =   &H00FFFF80&
  4.    Caption         =   "Check Four"
  5.    ClientHeight    =   5355
  6.    ClientLeft      =   705
  7.    ClientTop       =   1500
  8.    ClientWidth     =   6750
  9.    Height          =   5760
  10.    Left            =   645
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   5355
  13.    ScaleWidth      =   6750
  14.    Top             =   1155
  15.    Width           =   6870
  16.    Begin Timer Timer1 
  17.       Enabled         =   0   'False
  18.       Interval        =   200
  19.       Left            =   45
  20.       Top             =   4815
  21.    End
  22.    Begin CommandButton Command1 
  23.       Caption         =   "Command1"
  24.       Height          =   825
  25.       Left            =   450
  26.       TabIndex        =   1
  27.       Top             =   90
  28.       Width           =   1140
  29.    End
  30.    Begin PictureBox picFrame 
  31.       BackColor       =   &H0080FF80&
  32.       Height          =   4335
  33.       Left            =   540
  34.       ScaleHeight     =   4305
  35.       ScaleWidth      =   4305
  36.       TabIndex        =   0
  37.       Top             =   855
  38.       Width           =   4335
  39.       Begin Image imgblue 
  40.          Height          =   480
  41.          Left            =   1620
  42.          Picture         =   CHECK_4.FRX:0000
  43.          Top             =   1980
  44.          Width           =   480
  45.       End
  46.       Begin Image ImgRed 
  47.          Height          =   480
  48.          Left            =   405
  49.          Picture         =   CHECK_4.FRX:0302
  50.          Top             =   2835
  51.          Width           =   480
  52.       End
  53.       Begin Line LineX 
  54.          Index           =   0
  55.          X1              =   0
  56.          X2              =   4320
  57.          Y1              =   1215
  58.          Y2              =   1215
  59.       End
  60.       Begin Line LineY 
  61.          Index           =   0
  62.          X1              =   1260
  63.          X2              =   1260
  64.          Y1              =   315
  65.          Y2              =   4590
  66.       End
  67.    End
  68. Option Explicit
  69. Sub Command1_Click ()
  70. curcol = 4
  71. currow = 3
  72. timer1.Enabled = True
  73. End Sub
  74. Function FindRow (mycol As Integer) As Integer
  75. Dim rc As Integer
  76. For rc = 1 To squareh
  77.     If Not Abs(squares(mycol, rc)) = 1 Then
  78.         Exit For
  79.     End If
  80. FindRow = rc
  81. End Function
  82. Sub Form_Load ()
  83. picframe.Width = imgred.Width * squarew + (squarew * 2)
  84. picframe.Height = imgred.Height * squareh + (squareh * 2)
  85. picframe.Left = deltawidth
  86. picframe.Top = frmcheck_4.ScaleHeight - picframe.Height - deltaheight
  87. downrc = squareh
  88. currow = 1
  89. picframe.ScaleMode = 0
  90. picframe.ScaleHeight = -8
  91. picframe.ScaleWidth = 8
  92. picframe.ScaleLeft = 1
  93. picframe.ScaleTop = 8
  94. Dim rc As Integer
  95. If squarew > 2 Then
  96. For rc = 1 To squarew - 2
  97.     Load liney(rc)
  98.     liney(rc).Visible = True
  99. Next rc
  100. End If
  101. If squareh > 2 Then
  102. For rc = 1 To squareh - 2
  103.     Load linex(rc)
  104.     linex(rc).Visible = True
  105. Next rc
  106. End If
  107. For rc = 0 To squarew - 2
  108.     liney(rc).X1 = rc + 2
  109.     liney(rc).X2 = rc + 2
  110.     liney(rc).Y1 = 0
  111.     liney(rc).Y2 = squarew
  112. Next rc
  113. For rc = 0 To squareh - 2
  114.     linex(rc).Y1 = rc + 1
  115.     linex(rc).Y2 = rc + 1
  116.     linex(rc).X1 = 1
  117.     linex(rc).X2 = squareh + 1
  118. Next rc
  119. color = red
  120. End Sub
  121. Sub inputdata (datax As Integer, datay As Integer)
  122. squares(datax, datay) = color
  123. End Sub
  124. Sub picFrame_MouseUp (Button As Integer, Shift As Integer, x As Single, Y As Single)
  125. Dim clickcol As Integer
  126. curcol = Int(x)
  127. currow = FindRow(curcol)
  128. downrc = squareh
  129. timer1.Enabled = True
  130. inputdata curcol, currow
  131. End Sub
  132. Sub Timer1_Timer ()
  133. If downrc >= currow Then
  134.     If color = red Then
  135.     imgred.Move curcol, downrc
  136.     Else
  137.     imgblue.Move curcol, downrc
  138.     End If
  139.     downrc = downrc - 1
  140. imgred.ZOrder 1
  141. timer1.Enabled = False
  142. color = -1 * (color)
  143. End If
  144. End Sub
  145.